package com.videoaggre.zcl.ui.activity.agefans

import androidx.recyclerview.widget.GridLayoutManager
import com.videoaggre.zcl.R
import com.videoaggre.zcl.bean.AgefansItem
import com.videoaggre.zcl.common.getString
import com.videoaggre.zcl.parse.BaseParse
import com.videoaggre.zcl.parse.impl.AgefansParse
import com.videoaggre.zcl.ui.adapter.AgefansItemAdapter
import com.videoaggre.zcl.ui.fragment.parseHtml
import kotlinx.android.synthetic.main.activity_base_refresh.*

class AgefansLastUpdatedActivity : AgefansBaseRefreshActivity<AgefansItem>() {
    override fun initView() {
        titleView.titleStr = R.string.agefans_text_last_updated.getString()
        mBaseRecyclerAdapter = AgefansItemAdapter()
        super.initView()
        recyclerView.layoutManager = GridLayoutManager(this, 3)
    }

    override fun onReload() {
        parseHtml(BaseParse(this, this, AgefansParse.createUpdateLink(mAgefansPage.currentPage), loadService = mLoadService, refreshLayout = refreshLayout) {
            AgefansParse.parseLastUpdate(it) {
                handResult(it)
            }
        })
    }
}